<include file="Public:header" />
<!-- main content start-->
<div class="main-content" >

    <!-- header section start-->
    <div class="header-section">
        <!--toggle button start-->
        <a class="toggle-btn"><i class="fa fa-bars"></i></a>
        <!--toggle button end-->
        <!--notification menu start -->
        <div class="menu-right">
            <ul class="notification-menu">
                <li>
                    <a href="#" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                        <img src="__IMG__/photos/user-avatar.png" alt="" />
                        {$shopname}
                        <span class="caret"></span>
                    </a>
                    <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                        <li><a href="{:U('Rootadmin/Login/changePwd')}"><i class="fa fa-cog"></i>  修改密码</a></li>
                        <li><a href="{:U('Rootadmin/Login/logout')}"><i class="fa fa-cog"></i>  退出登录</a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <!--notification menu end -->
    </div>
    <!-- header section end-->
    <!-- page heading start-->
    <div class="page-heading">
        <h3>
            系统设置
        </h3>
        <ul class="breadcrumb">
            <li>
                <a href="#">首页</a>
            </li>
            <li> 系统设置 </li>
            <li class="active"> 管理员列表 </li>
        </ul>
    </div>
    <!-- page heading end-->

    <!--body wrapper start-->
    <div class="wrapper">

        <section class="panel">
            <a class="btn btn-success" href="{:U('Rootadmin/system/add')}" id="editable-sample_new" style="margin: 15px;">
                <i class="fa fa-plus"></i> 添加管理员
            </a>
            <div class="panel-body">

                <section id="unseen">
                    <table class="table table-bordered table-striped table-condensed">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>账号</th>
                            <th>添加ip</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <volist name="info" id="vo">
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.name}</td>
                                <td>{$vo.ip}</td>
                                <td>
                                    <empty name="vo.addtime">
                                        -
                                        <else/>
                                        {$vo.addtime|date="Y-m-d H:i:s",###}
                                    </empty>
                                </td>
                                <td>
                                    <a class="btn btn-xs btn-info" href="{:U('Rootadmin/system/edit',array('id'=>$vo['id']))}"><i class="fa fa-edit"></i>修改</a>
                                    <a class="btn btn-xs btn-warning userDelete" onclick="del({$vo.id})"><i class="fa fa-trash-o"></i>删除</a>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
                    </table>


                    <div class="row">
                        <div class="col-lg-12">
                            <div class="dataTables_paginate paging_bootstrap pagination">
                                {$pages}
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </section>
    </div>
    <!--body wrapper end-->
    <!-- main content end-->
    <script>
        function del(id){
            if(confirm("确认删除")){
                var url="{:U('Rootadmin/system/delete')}";
                $.post(url,{id:id},function(res){
                    if(res.code==200){
                        toast(res.msg,true);
                        location.reload()
                    }else{
                        toast(res.msg,false);
                    }
                });
                return false;
            }else{
                return false;
            }
        }
    </script>
    <include file="Public:footer" />